package com.example.cloud.service.statistics.impl;

import com.example.cloud.dao.statistics.StatisticsFinancialRepository;
import com.example.cloud.model.statistics.StatisticsFinancial;
import com.example.cloud.service.statistics.StatisticsFinancialService;
import com.example.cloud.utils.BusinessUtil;
import org.beetl.sql.core.SQLManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 * Created by wangtao on 2018/5/22.
 */
@Service
public class StatisticsFinancialServiceImpl implements StatisticsFinancialService {

    @PersistenceContext
    EntityManager em;

    @Autowired
    private SQLManager sqlManager;

    @Autowired
    private StatisticsFinancialRepository statisticsFinancialRepository;

    @Override
    public void doSave(StatisticsFinancial record) {
        BusinessUtil.appendRecord(record);
        statisticsFinancialRepository.save(record);
    }
}
